package String;

/**
 * 截取字符串
 * String substring (int start,int end)
 * 截取当前字符串和
 *
 */

public class SubstringDemo {
    public static void main(String[] args) {

        String str = "www.tedu.cn";
        //截取下标4（含）-8（不含）内的字符串内容
        String sub = str.substring(4,8);
        System.out.println(sub);
        //截取从下标4开始到字符串末尾的内容
        sub =str.substring(4);
        System.out.println(sub);
    }
}
